package com.boot.unity.api.modules.train.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.boot.unity.api.modules.train.entity.PhysicalExamination;

@Mapper
public interface PhysicalExaminationDao {

    @Select("select * from train_physical_examination t where t.id = #{id}")
    PhysicalExamination getById(Long id);

    @Delete("delete from train_physical_examination where id = #{id}")
    int delete(Long id);

    int update(PhysicalExamination physicalExamination);
    
    //@Options(useGeneratedKeys = true, keyProperty = "id")
    //@Insert("insert into train_physical_examination(stu_id, stu_name, school_id, school_name, dmv_id, dmv_name, area_id, area_name, card_type, card_no, train_type, status, examination_date, add_time, update_time, deleted) values(#{stuId}, #{stuName}, #{schoolId}, #{schoolName}, #{dmvId}, #{dmvName}, #{areaId}, #{areaName}, #{cardType}, #{cardNo}, #{trainType}, #{status}, #{examinationDate}, #{createTime}, #{updateTime}, #{deleted})")
    int save(PhysicalExamination physicalExamination);
    
    int count(@Param("params") Map<String, Object> params);

    List<PhysicalExamination> list(@Param("params") Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);
}
